package com.c.ctgproject.adapter.service

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.c.ctgproject.R
import com.c.ctgproject.base.BaseRecyclerViewAdapter
import com.c.ctgproject.entity.service.ReturnHistoryEntity
import com.c.ctgproject.utils.handlerNull

class ServiceReturnRecordAdapter (private val context: Context,private val mList:List<ReturnHistoryEntity.DataBean>):BaseRecyclerViewAdapter(context, mList){

    override fun createViewHolder(parent: ViewGroup): RecyclerView.ViewHolder {
        val view=LayoutInflater.from(context).inflate(R.layout.item_service_return_record_list,parent,false)
        return MyViewHolder(view)
    }

    override fun handlerData(holder: RecyclerView.ViewHolder, position: Int) {
        if (holder is MyViewHolder){
            val data=mList[position]
            holder.mContainerTV.text=data.remark.handlerNull()
            holder.mTimeTV.text=data.createTime.handlerNull()
            holder.mUserTV.text=data.createBy.handlerNull()
        }
    }
    inner class MyViewHolder(view:View):RecyclerView.ViewHolder(view){
        val mContainerTV:TextView=view.findViewById(R.id.mContainerTV)
        val mUserTV:TextView=view.findViewById(R.id.mUserTV)
        val mTimeTV:TextView=view.findViewById(R.id.mTimeTV)

    }

}